{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "x_data = [338., 333., 328., 207., 226., 25., 179., 60., 208., 606.]\n",
    "y_data = [640., 633., 619., 393., 428., 27., 193., 66., 226., 1591.]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "x_d = np.asarray(x_data)\n",
    "y_d = np.asarray(y_data)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "x = np.arange(-200, -100, 1)\n",
    "y = np.arange(-5, 5, 0.1)\n",
    "Z = np.zeros((len(x), len(y)))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "X, Y = np.meshgrid(x, y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[-200, -199, -198, ..., -103, -102, -101],\n",
       "       [-200, -199, -198, ..., -103, -102, -101],\n",
       "       [-200, -199, -198, ..., -103, -102, -101],\n",
       "       ...,\n",
       "       [-200, -199, -198, ..., -103, -102, -101],\n",
       "       [-200, -199, -198, ..., -103, -102, -101],\n",
       "       [-200, -199, -198, ..., -103, -102, -101]])"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on function meshgrid in module numpy:\n",
      "\n",
      "meshgrid(*xi, copy=True, sparse=False, indexing='xy')\n",
      "    Return coordinate matrices from coordinate vectors.\n",
      "    \n",
      "    Make N-D coordinate arrays for vectorized evaluations of\n",
      "    N-D scalar/vector fields over N-D grids, given\n",
      "    one-dimensional coordinate arrays x1, x2,..., xn.\n",
      "    \n",
      "    .. versionchanged:: 1.9\n",
      "       1-D and 0-D cases are allowed.\n",
      "    \n",
      "    Parameters\n",
      "    ----------\n",
      "    x1, x2,..., xn : array_like\n",
      "        1-D arrays representing the coordinates of a grid.\n",
      "    indexing : {'xy', 'ij'}, optional\n",
      "        Cartesian ('xy', default) or matrix ('ij') indexing of output.\n",
      "        See Notes for more details.\n",
      "    \n",
      "        .. versionadded:: 1.7.0\n",
      "    sparse : bool, optional\n",
      "        If True a sparse grid is returned in order to conserve memory.\n",
      "        Default is False.\n",
      "    \n",
      "        .. versionadded:: 1.7.0\n",
      "    copy : bool, optional\n",
      "        If False, a view into the original arrays are returned in order to\n",
      "        conserve memory.  Default is True.  Please note that\n",
      "        ``sparse=False, copy=False`` will likely return non-contiguous\n",
      "        arrays.  Furthermore, more than one element of a broadcast array\n",
      "        may refer to a single memory location.  If you need to write to the\n",
      "        arrays, make copies first.\n",
      "    \n",
      "        .. versionadded:: 1.7.0\n",
      "    \n",
      "    Returns\n",
      "    -------\n",
      "    X1, X2,..., XN : ndarray\n",
      "        For vectors `x1`, `x2`,..., 'xn' with lengths ``Ni=len(xi)`` ,\n",
      "        return ``(N1, N2, N3,...Nn)`` shaped arrays if indexing='ij'\n",
      "        or ``(N2, N1, N3,...Nn)`` shaped arrays if indexing='xy'\n",
      "        with the elements of `xi` repeated to fill the matrix along\n",
      "        the first dimension for `x1`, the second for `x2` and so on.\n",
      "    \n",
      "    Notes\n",
      "    -----\n",
      "    This function supports both indexing conventions through the indexing\n",
      "    keyword argument.  Giving the string 'ij' returns a meshgrid with\n",
      "    matrix indexing, while 'xy' returns a meshgrid with Cartesian indexing.\n",
      "    In the 2-D case with inputs of length M and N, the outputs are of shape\n",
      "    (N, M) for 'xy' indexing and (M, N) for 'ij' indexing.  In the 3-D case\n",
      "    with inputs of length M, N and P, outputs are of shape (N, M, P) for\n",
      "    'xy' indexing and (M, N, P) for 'ij' indexing.  The difference is\n",
      "    illustrated by the following code snippet::\n",
      "    \n",
      "        xv, yv = np.meshgrid(x, y, sparse=False, indexing='ij')\n",
      "        for i in range(nx):\n",
      "            for j in range(ny):\n",
      "                # treat xv[i,j], yv[i,j]\n",
      "    \n",
      "        xv, yv = np.meshgrid(x, y, sparse=False, indexing='xy')\n",
      "        for i in range(nx):\n",
      "            for j in range(ny):\n",
      "                # treat xv[j,i], yv[j,i]\n",
      "    \n",
      "    In the 1-D and 0-D case, the indexing and sparse keywords have no effect.\n",
      "    \n",
      "    See Also\n",
      "    --------\n",
      "    index_tricks.mgrid : Construct a multi-dimensional \"meshgrid\"\n",
      "                     using indexing notation.\n",
      "    index_tricks.ogrid : Construct an open multi-dimensional \"meshgrid\"\n",
      "                     using indexing notation.\n",
      "    \n",
      "    Examples\n",
      "    --------\n",
      "    >>> nx, ny = (3, 2)\n",
      "    >>> x = np.linspace(0, 1, nx)\n",
      "    >>> y = np.linspace(0, 1, ny)\n",
      "    >>> xv, yv = np.meshgrid(x, y)\n",
      "    >>> xv\n",
      "    array([[0. , 0.5, 1. ],\n",
      "           [0. , 0.5, 1. ]])\n",
      "    >>> yv\n",
      "    array([[0.,  0.,  0.],\n",
      "           [1.,  1.,  1.]])\n",
      "    >>> xv, yv = np.meshgrid(x, y, sparse=True)  # make sparse output arrays\n",
      "    >>> xv\n",
      "    array([[0. ,  0.5,  1. ]])\n",
      "    >>> yv\n",
      "    array([[0.],\n",
      "           [1.]])\n",
      "    \n",
      "    `meshgrid` is very useful to evaluate functions on a grid.\n",
      "    \n",
      "    >>> import matplotlib.pyplot as plt\n",
      "    >>> x = np.arange(-5, 5, 0.1)\n",
      "    >>> y = np.arange(-5, 5, 0.1)\n",
      "    >>> xx, yy = np.meshgrid(x, y, sparse=True)\n",
      "    >>> z = np.sin(xx**2 + yy**2) / (xx**2 + yy**2)\n",
      "    >>> h = plt.contourf(x,y,z)\n",
      "    >>> plt.show()\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(np.meshgrid)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python [conda env:py38_env] *",
   "language": "python",
   "name": "conda-env-py38_env-py"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
